<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.dsrk.sysusage.*"%>
<%@ page import="java.sql.ResultSet"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>left_bottom</title>
</head>
<body>
<%
String TYPE = request.getParameter("TYPE");
%>
<%=TYPE%>
<br>
<br>
<%
	Display display = new Display();

	if (TYPE != null) {
		if (TYPE.equals("cpu")) {
			ResultSet rs = display
			.Query("SELECT DISTINCT groupname FROM sysusage_group");
			while (rs.next()) {
		String groupname = rs.getString(1);
		out.println("<a href='right.jsp?TYPE=" + TYPE
				+ "&groupname=" + groupname + "' target=right>"
				+ groupname + "</a><br>");
			}

			out.println("<a href='right.jsp?TYPE=" + TYPE
			+ "&groupname=' target=right>ALL(*)</a><br>");
		} else if (TYPE.equals("mem")) {
			ResultSet rs = display
			.Query("SELECT DISTINCT groupname FROM sysusage_group");
			while (rs.next()) {
		String groupname = rs.getString(1);
		out.println("<a href='right.jsp?TYPE=" + TYPE
				+ "&groupname=" + groupname + "' target=right>"
				+ groupname + "</a><br>");
			}

			out.println("<a href='right.jsp?TYPE=" + TYPE
			+ "&groupname=' target=right>ALL(*)</a><br>");
		} else if (TYPE.equals("disk")) {
			ResultSet rs = display
			.Query("SELECT DISTINCT property FROM sysusage_rawdata WHERE property like 'disk%' AND property NOT LIKE '%tot'");
			while (rs.next()) {
		String property = rs.getString(1);
		out.println("<a href='right.jsp?TYPE=" + TYPE
				+ "&property=" + property + "' target=right>"
				+ property + "</a><br>");
			}

			out.println("<a href='right.jsp?TYPE=" + TYPE
			+ "&property=' target=right>ALL(*)</a><br>");
		} else if (TYPE.equals("tr_hourly") || TYPE.equals("tr_daily")) {
			ResultSet rs = display
			.Query("SELECT DISTINCT property FROM sysusage_rawdata WHERE property LIKE '%w2h%' OR property LIKE 'edms_%' UNION VALUES 'edms_dn','edms_up','w2h'");
			while (rs.next()) {
		out.println("<a href='right.jsp?TYPE=" + TYPE
				+ "&property=" + rs.getString(1)
				+ "' target=right>" + rs.getString(1)
				+ "</a><br>");
			}
		} else if (TYPE.equals("nic")) {
			ResultSet rs = display
			.Query("SELECT DISTINCT groupname FROM sysusage_group");
			while (rs.next()) {
		String property = rs.getString(1);
		out.println("<a href='right.jsp?TYPE=" + TYPE
				+ "&groupname=" + property + "' target=right>"
				+ property + "</a><br>");
			}

			out.println("<a href='right.jsp?TYPE=" + TYPE
			+ "&groupname=' target=right>ALL</a><br>");
		}
	}
%>
</br>
</body>
</html>
